package com.itheima.admin.service.impl;

import com.itheima.admin.mapper.AdUserMapper;
import com.itheima.admin.pojo.AdUser;
import com.itheima.admin.pojo.AdUserLogin;
import com.itheima.admin.service.AdUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.common.exception.LeadNewsException;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @description <p>管理员用户信息 业务实现</p>
 *
 * @version 1.0
 * @package com.itheima.admin.service.impl
 */
@Service
public class AdUserServiceImpl extends ServiceImpl<AdUserMapper, AdUser> implements AdUserService {
    /**
     * 登录验证
     *
     * @param adUser
     * @return
     */
    @Override
    public Map<String, Object> login(AdUser adUser) {
        String name = adUser.getName();
        String password = adUser.getPassword();
        if (name==null||password==null){
            throw  new LeadNewsException("用户名或密码为空");
        }
        AdUser user = query().eq("name", name).one();
        return null;
}
